package com.qf.test;

import com.qf.mapper.OrderMapper;
import com.qf.pojo.Order;
import com.qf.utils.MyBatisUtils;
import org.junit.Test;

import java.util.List;

/**
 * @author mkr
 * @version V1.0
 * @Project mybatis_demo
 * @Package com.qf.test
 * @Description: 订单与商品测试类
 * @Date 2022/7/7 21:29
 */
public class OrderAndProduct {
    @Test
    public void findUserAndOrser() {
        OrderMapper orderMapper = MyBatisUtils.getMapper(OrderMapper.class);
        try {
            List<Order> orderList = orderMapper.OrderAndProduct();
            for (Order order : orderList) {
                System.out.println(order);
            }
            MyBatisUtils.commit();
        } catch (Exception e) {
            e.printStackTrace();
            MyBatisUtils.rollback();
        }

    }
}
